package com.example.service.synch;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author ChenXiaoBin
 * on 2020-08-17
 */
public class Actomic {

    static AtomicInteger count = new AtomicInteger(0);

    public static void main(String[] args) {
        Thread[]    threads = new Thread[1000];

        for (int i = 0; i<threads.length; i++) {
            threads[i] = new Thread(() -> {
                for (int k = 0; k<1000; k++) {
                    count.incrementAndGet();
                }
            });
        }
    }
}
